package com.ovo.dailypayaccount.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ovo.dailypayaccount.dao.UserInfoDao;
import com.ovo.dailypayaccount.entity.UserInfo;



@Service("userService")
public class UserServiceImpl implements BaseUserService {
	@Autowired
	private UserInfoDao userInfoDao;

	public UserInfo getUserById(int userId) {
		return userInfoDao.selectByPrimaryKey(userId);
	}

	public boolean addUser(UserInfo record) {
		boolean result = false;
		try {
			userInfoDao.insert(record);
			result = true;
		} catch (Exception e) {
			e.printStackTrace();
		}

		return result;
	}

	public UserInfo getUserByName(String name) {
		return userInfoDao.selectByName(name);
	}

	@Override
	public int updateByPrimaryKeySelective(UserInfo record) {
		// TODO Auto-generated method stub
		return userInfoDao.updateByPrimaryKeySelective(record);
	}

	@Override
	public int deleteByPrimaryKey(Integer id) {
		return userInfoDao.deleteByPrimaryKey(id);
	}
	

}
